package com.darren.archive.entity;

import com.darren.framework.entity.BaseEntity;
import com.darren.framework.utils.Constant;
import org.hibernate.annotations.ResultCheckStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = Constant.TABLE_NAME_PREV + "cities")
@SQLDelete(sql = "update " + Constant.TABLE_NAME_PREV + "cities set is_delete = true where id=?", check = ResultCheckStyle.COUNT)
@Where(clause = "is_delete  = false")
public class City extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 2861478466077717714L;

    /**
     * 城市编号
     */
    @Column(name = "city_code", columnDefinition = "varchar(20) comment '城市编号'")
    private String cityCode;

    /**
     * 城市名字
     */
    @Column(name = "city_name", columnDefinition = "varchar(50) comment '城市名字'")
    private String cityName;

    /**
     * 省份编号
     */
    @Column(name = "province_code", columnDefinition = "varchar(20) comment '省份编号'")
    private String provinceCode;


    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

}
